<script>
window.onload = function() {
    var img = document.createElement('img');
    img.src = 'http://example.test:8080/security/resources/compass.jpg';
    img.srcset = '';
    img.addEventListener('load', function () {
        if (window.opener)
            window.opener.postMessage('done', '*');
    });
    document.body.appendChild(img);
};
</script>
